home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
GLOBAL.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
637b
|
28 lines
' GLOBAL.BAS
' This program demonstrates the use of a global variable.
DECLARE SUB AddGame () ' declare AddGame subprogram
COMMON SHARED game$ ' declare game$ as a global variable
game$ = "Chess" ' initialize game$ with value of "Chess"
CLS
PRINT " In the main program, game$ = "; game$ ' display in main prog.
AddGame ' display in subprogram
PRINT " Back in the main program, game$ = "; game$ ' display in main prog.
END
SUB AddGame
game$ = game$ + " and backgammon"
PRINT "In the AddGame subprogram, game$ = "; game$
END SUB